package v1

import (
	"github.com/gogf/gf/v2/frame/g"
	vo "ruoyi-vue-pro-go/internal/model/vo"
)

type LoginReq struct {
	g.Meta              `method:"post" path:"/admin-api/system/auth/login" noAuth:"true" tags:"用户" sm:"登录" dc:"登录" `
	Username            string `v:"required" dc:"用户名"`
	Password            string `v:"required" dc:"密码"`
	CaptchaVerification string `json:"captchaVerification"`
	SocialType          string `json:"socialType"`
	SocialCode          string `json:"socialCode"`
	SocialState         string `json:"socialState"`
}

type LoginRes struct {
	UserId       int64  `json:"userId"`
	AccessToken  string `json:"accessToken"`
	RefreshToken string `json:"refreshToken"`
	ExpiresTime  string `json:"expiresTime"`
}

type LogoutReq struct {
	g.Meta `method:"post" path:"/admin-api/system/auth/logout" tags:"用户" sm:"登出" dc:"登出" `
}

type LogoutRes struct{}

type GetPermissionInfoReq struct {
	g.Meta `method:"get" path:"/admin-api/system/auth/get-permission-info" tags:"用户" sm:"权限" dc:"权限" `
}

type GetPermissionInfoRes struct {
	User        *vo.SystemUserVO   `json:"user"`
	Roles       []string           `json:"roles"`
	Permissions []string           `json:"permissions"`
	List        []*vo.SystemMenuVO `json:"menus"`
}

type RefreshReq struct {
	g.Meta `method:"post" path:"/admin-api/system/auth/refresh-token" tags:"用户" sm:"刷新token" dc:"刷新token" `
	Token  string `json:"token"`
}

type RefreshRes struct {
	UserId       int64  `json:"userId"`
	AccessToken  string `json:"accessToken"`
	RefreshToken string `json:"refreshToken"`
	ExpiresTime  string `json:"expiresTime"`
}
